import { Tag } from 'antd';

export const getStatusTag = (status: number) => {
  switch (status) {
    case 0:
      return <Tag color="success">通过</Tag>;
    case -1:
      return <Tag color="error">答案错误</Tag>;
    case -2:
      return <Tag color="error">编译错误</Tag>;
    case 1:
      return <Tag color="warning">CPUtime超时</Tag>;
    case 2:
      return <Tag color="warning">Realtime超时</Tag>;
    case 3:
      return <Tag color="warning">内存超限</Tag>;
    case 4:
      return <Tag color="error">运行时错误</Tag>;
    case 5:
      return <Tag color="error">系统错误</Tag>;
    case 6:
      return <Tag color="default">等待评测</Tag>;
    case 7:
      return <Tag color="default">评测中</Tag>;
    case 8:
      return <Tag color="warning">部分通过</Tag>;
    default:
      return <Tag color="default">未知</Tag>;
  }
}; 

// COMPILE_ERROR = -2          # 编译错误
//     WRONG_ANSWER = -1          # 答案错误
//     ACCEPTED = 0               # 通过
//     CPU_TIME_LIMIT_EXCEEDED = 1  # CPU时间超限
//     REAL_TIME_LIMIT_EXCEEDED = 2 # 实际时间超限
//     MEMORY_LIMIT_EXCEEDED = 3    # 内存超限
//     RUNTIME_ERROR = 4          # 运行时错误
//     SYSTEM_ERROR = 5           # 系统错误
//     PENDING = 6               # 等待评测
//     JUDGING = 7               # 评测中
//     PARTIALLY_ACCEPTED = 8     # 部分通过(OI模式)